From: Jonas Dreßler Date: Thu, 4 Jul 2019 15:33:06 +0000 (+0200) Subject: st/button: Ungrab device before calling st_button_release X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~72 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0bdd1b6fc47433c723c7f368fe842a9ddac082bf;p=gnome-shell.git st/button: Ungrab device before calling st_button_release Since priv->device gets set to NULL inside st_button_release, ungrab the input device before calling st_button_release and avoid clutter_input_device_ungrab failing with a critical error. This fixes a regression introduced with d5a1a888d91b9456632a8393cf14c443e6df6a5b While at it, also remove the superfluous line resetting priv->device to NULL and move the check for priv->grabbed into an elseif block since there should be no case where StButton has both grabs at the same time. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/614 --- diff --git a/src/st/st-button.c b/src/st/st-button.c index fb7ccd80d..3897c7c87 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -779,18 +779,15 @@ st_button_fake_release (StButton *button) clutter_input_device_sequence_ungrab (priv->device, priv->press_sequence); } - - if (priv->pressed || priv->press_sequence) - st_button_release (button, priv->device, - priv->pressed, 0, NULL); - - if (priv->grabbed) + else if (priv->grabbed) { priv->grabbed = 0; clutter_input_device_ungrab (priv->device); } - priv->device = NULL; + if (priv->pressed || priv->press_sequence) + st_button_release (button, priv->device, + priv->pressed, 0, NULL); } /******************************************************************************/